﻿#ifndef _FONT_
#define _FONT_

#if 0

#include "./sdl/include/SDL.h"
#include "stb_truetype.h"

class CFont
{
public :
	enum
	{
		FONT_SOLID = 0,
		FONT_SHADED,
		FONT_BLENDED
	};

public :
	CFont();
	~CFont();

	float	getTextLength(stbtt_bakedchar *chardata, const char* text);
	void	getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q);

	SDL_Surface *	GetSurface() { return m_surface; }
	void			Render(char *msg, int method = FONT_BLENDED );

private :
	SDL_Color		m_textColor;
	SDL_Color		m_backColor;

	SDL_Surface *	m_surface;

	unsigned char*	m_fontBuffer;
	unsigned char*	m_bmap;
};



#else
#include "./sdl/include/SDL_ttf.h"
#pragma comment (lib, "./sdl/lib/SDL_ttf.lib")

class CFont
{
public :
	enum
	{
		FONT_SOLID = 0,
		FONT_SHADED,
		FONT_BLENDED
	};

public :
	CFont();
	~CFont();

	SDL_Surface *	GetSurface() { return m_surface; }
	void	Render(wchar_t *msg, int method = FONT_BLENDED );


private :
	SDL_Color		m_textColor;
	SDL_Color		m_backColor;

	TTF_Font *		m_font;
	SDL_Surface *	m_surface;
};


#endif

#endif